package com.kk.model;

import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import java.util.ArrayList;
import java.util.List;

/**
 * @author: kevin
 * @date: 2018-11-28 22:53
 */
@Entity
@Data
@EqualsAndHashCode(callSuper = true) //@Data会生成equals和hashCode方法，这个注解作用：使用父类的equals和hashCode方法
public class Content extends BaseEntity {
    //标题
    private String title;
    //公司名称
    private String companyName;
    //地址
    private String address;
    //手机
    private String tel;
    //导航列表 逗号分隔
    @OneToMany(targetEntity = Nav.class, fetch = FetchType.EAGER, cascade = CascadeType.ALL)
    private List<Nav> navList = new ArrayList<>();
    //内容
    private String content;

    private String aboutUs;

    private String content1;

    private String content2;
    private String content3;
    private String content4;
    private String content5;
    private String content6;
    private String content7;
    private String content8;

    public Content() {
    }


    public Content(String title, String companyName, String address, String tel, List<Nav> navList, String content, String aboutUs, String content1, String content2, String content3, String content4, String content5, String content6, String content7,String content8) {
        this.title = title;
        this.companyName = companyName;
        this.address = address;
        this.tel = tel;
        this.navList = navList;
        this.content = content;
        this.aboutUs = aboutUs;
        this.content1 = content1;
        this.content2 = content2;
        this.content3 = content3;
        this.content4 = content4;
        this.content5 = content5;
        this.content6 = content6;
        this.content7 = content7;
        this.content8 = content8;
    }
}
